/**
 * 
 */
package ${basepackage}.manager.op;

import ${basepackage}.manager.exception.ServiceException;
import ${basepackage}.model.criteria.op.OpUserCriteria;
import ${basepackage}.model.po.op.OpUser;
import ${basepackage}.model.vo.common.Page;
import ${basepackage}.model.vo.op.opuser.AddOpUserForm;
import ${basepackage}.model.vo.op.opuser.OpUserRow;
import ${basepackage}.model.vo.op.opuser.UpdateAccountForm;
import ${basepackage}.model.vo.op.opuser.UpdateOpUserForm;
import ${basepackage}.model.vo.op.opuser.UpdatePasswordForm;

/**
 * @author "Jiance Qin"
 * 
 * @date 2014年2月24日
 * 
 * @time 下午5:29:53
 * 
 */
public interface OpUserManager {

	/**
	 * 根据ID删除.
	 * 
	 * @param id
	 * @return
	 * @throws ServiceException
	 */
	public boolean delete(Long id) throws ServiceException;

	/**
	 * 根据查询条件分页获取用户的列表.
	 * 
	 * @param criteria
	 * @param offset
	 * @param limit
	 * @return
	 * @throws ServiceException
	 */
	public Page<OpUserRow> getOpUsers(OpUserCriteria criteria, int offset,
			int limit) throws ServiceException;

	/**
	 * 添加新用户.
	 * 
	 * @param addOpUserForm
	 * @return
	 * @throws ServiceException
	 */
	public OpUserRow addOpUser(AddOpUserForm addOpUserForm)
			throws ServiceException;

	/**
	 * 更新用户.
	 * 
	 * @param updateOpUserForm
	 * @return
	 * @throws ServiceException
	 */
	public OpUserRow updateOpUser(UpdateOpUserForm updateOpUserForm)
			throws ServiceException;

	/**
	 * 根据用户ID获取后台用户信息，并获取其相关角色信息.
	 * 
	 * @param opUserId
	 * @return
	 * @throws ServiceException
	 */
	public OpUser getOpUserWithRoles(Long opUserId) throws ServiceException;

	/**
	 * 更新账号信息.
	 * 
	 * @param updateAccountForm
	 * @return
	 * @throws ServiceException
	 */
	public OpUser updateAccount(UpdateAccountForm updateAccountForm)
			throws ServiceException;

	/**
	 * 根据用户名获取后台用户.
	 * 
	 * @param username
	 * @return
	 * @throws ServiceException
	 */
	public OpUserRow getWithRolesByUsername(String username)
			throws ServiceException;

	/**
	 * 修改账号密码.
	 * 
	 * @param updatePasswordForm
	 * @return
	 * @throws ServiceException
	 */
	public boolean updatePassword(UpdatePasswordForm updatePasswordForm)
			throws ServiceException;
}
